<template>
	<div class="body">
		<div class="cont">
			<div class="title">登录密码重置</div>
			<div>
				<div class="worlds">
					<span>>身份验证</span>
					<span>>登录密码重置</span>
					<span>>重置完成</span>
				</div>
				<div class="line"><img src="../../../static/img/line2.png" alt=""></div>
			</div>
			<div class="phone">
				<label>短信验证码：<input class="text" type="text" id="text" placeholder="请输入手机号(暂未实现)"></label><br /><br />
				<label>登录密码：<input class="text text2" type="password" id="text2" placeholder="请输入密码"></label><br /><br />
				<label>确认密码：<input class="text text3" type="password" id="text3" placeholder="请确认密码"></label>
			</div>
			<div class="next" @click="reset"><input type="button" >下一步</div>
		</div>
	</div>
</template>

<script>
import axios from 'axios'
export default{
	name:'ResetPassword',
	data(){
		return{
			
		}
	},
	methods:{
		reset(){
			var getPhone = this.$route.query.phone;
			var phoneInput = document.getElementById('text').value;
			var password = document.getElementById('text2').value;
			var surePassword = document.getElementById('text3').value;
			
			// console.log(phone)
			if(phoneInput == '' || phoneInput == null){
				alert('请输入注册手机号');
				return false
			}else{
				if(password == '' || password == null || surePassword == '' || surePassword == null || password != surePassword){
					alert('密码或确认密码有误');
					return false
				}else{
					axios.post(('http://localhost:3000/api/user/updateUser'),{
						password:password,
						phone:getPhone
					},{}).then(function(response){
						// console.log('next')
						
					});this.$router.push('/relogin')
				}
			}
		}
	},
	mounted(){
		
	}
}
</script>

<style scoped="scoped">
.body{
	position: relative;
	top: 0;
	padding-top: 80px;
	padding-bottom: 50px;
	/* padding-left: 200px; */
	background-image: url(../../../static/img/zhuce_bj.jpg);
	background-size: 100% 100%;
}
.cont{
	width: 1000px;
	height: 500px;
	margin: auto;
	background: #ffffff8c;
}
.title{
	font-size: 22px;
	font-weight: 800;
	text-align: center;
	padding-top: 40px;
	color: #00B7FF;
}
.worlds{
	width: 100%;
	padding-bottom: 10px;
	padding-top: 50px;
}
.worlds span:first-child{
	color: #00B7FF;
	padding-left: 184px;
}
.worlds span:nth-child(2){
	padding-left: 195px;
	color: #00B7FF;
}
.worlds span:nth-child(3){
	padding-left: 202px;
}
.line{
	text-align: center;
}
.phone{
	padding-top: 30px;
	padding-left: 220px;
	font-size: 16px;
}
.text{
	margin-left: 15px;
	height: 40px;
	width: 280px;
	background: #efefef;
	padding-left: 15px;
}
.text:hover{
	border: 1px solid #00B7FF;
}
.next{
	width: 200px;
	height: 40px;
	line-height: 40px;
	text-align: center;
	font-size: 18px;
	font-weight: 600;
	color: #FFFFFF;
	margin-top: 60px;
	margin-left: 230px;
	background: #00B7FF;
}
.next:hover{
	cursor: pointer;
}
.text2, .text3{
	margin-left: 30px;
}
</style>
